home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / font / AttributeMap.class (.txt) next >
Encoding:
Java Class File  |  2006-11-29  |  1.7 KB  |  48 lines

  1. package sun.font;
  2.  
  3. import java.awt.font.TextAttribute;
  4. import java.util.AbstractMap;
  5. import java.util.HashMap;
  6. import java.util.Map;
  7. import java.util.Set;
  8.  
  9. public final class AttributeMap extends AbstractMap<TextAttribute, Object> {
  10.    private AttributeValues values;
  11.    private Map<TextAttribute, Object> delegateMap;
  12.    private static boolean first = false;
  13.  
  14.    public AttributeMap(AttributeValues var1) {
  15.       this.values = var1;
  16.    }
  17.  
  18.    public Set<Map.Entry<TextAttribute, Object>> entrySet() {
  19.       return this.delegate().entrySet();
  20.    }
  21.  
  22.    public Object put(TextAttribute var1, Object var2) {
  23.       return this.delegate().put(var1, var2);
  24.    }
  25.  
  26.    public AttributeValues getValues() {
  27.       return this.values;
  28.    }
  29.  
  30.    private Map<TextAttribute, Object> delegate() {
  31.       if (this.delegateMap == null) {
  32.          if (first) {
  33.             first = false;
  34.             Thread.dumpStack();
  35.          }
  36.  
  37.          this.delegateMap = this.values.toMap(new HashMap(27));
  38.          this.values = null;
  39.       }
  40.  
  41.       return this.delegateMap;
  42.    }
  43.  
  44.    public String toString() {
  45.       return this.values != null ? "map of " + this.values.toString() : super.toString();
  46.    }
  47. }
  48.